package com.job.sun.HomeWork0722;

/**
 * @author 张春阳
 * @version 1.0
 * @since 2022-07-22 22:40:27
 */
public class Student {
   private int age ;

    public int getAge() {
        return age;
    }

    public void setAge(int age) throws AgeException {
        if(age<18||age>28){
            throw new AgeException("年龄不符合规定");
        }
        this.age=age;
    }

}